/***************************************************************************************************
 *
 * Project: Utilities
 *
 * Class: DisplayFormats
 *
 * File name: DisplayFormats.java
 *
 * Sep 20, 2007
 *
 **************************************************************************************************/

package com.eastmountain.util;


public class DisplayFormats {

    /***********************************************************************************************
     *
     * stringToHex
     *
     **********************************************************************************************/

    public static String stringToHex( String characterString ) {

        char[] characters = characterString.toCharArray();
        String hex = "";

        for ( char element : characters ) {

            String c = String.format( "%04X", (int) element );

            hex = hex + "u" + new String( c ) + " ";

        }

        return (hex);

    }


    /***********************************************************************************************
     *
     *   charToUnicodeString
     *
     **********************************************************************************************/

    public static String charToUnicodeString( int character ) {

        String unicode = String.format( "%04X", character );

        return( unicode );

    }

}
